//
//  HomeViewController.m
//  囧途
//
//  Created by fly on 16/3/3.
//  Copyright © 2016年 fly. All rights reserved.
//

#import "HomeViewController.h"
#import "ControllerManger.h"
#import "LeftViewController.h"
#import "OrderCarViewController.h"
#import "PushCarViewController.h"
#import <AVObject.h>
#import <AVRelation.h>
#import <AVUser.h>
@interface HomeViewController ()
@property (strong, nonatomic) IBOutlet UIButton *orderButton;

@property (strong, nonatomic) IBOutlet UIButton *pushButton;

@property(strong, nonatomic)LeftViewController * leftView;

@property(assign, nonatomic) int NSnumber;

@property(nonatomic, strong)AVUser * currentUser;
@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _currentUser = [AVUser currentUser];
    
    [self initializeInterface];
    
}

-(void)initializeInterface
{
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"首页背景1"]];
    
    self.navigationItem.title = @"首页";
    
    UIBarButtonItem * barButton = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"定位图片1"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonPressed:)];

    self.navigationItem.leftBarButtonItem = barButton;

    
    _orderButton.layer.cornerRadius = 30;
    
    _orderButton.layer.masksToBounds = YES;
    
    _pushButton.layer.cornerRadius = 30;
    
    _pushButton.layer.masksToBounds = YES;
    
}

- (IBAction)orderButtonPressed:(UIButton *)sender {
    
    OrderCarViewController * orderCar = [[OrderCarViewController alloc]init];
    
    [self.navigationController pushViewController:orderCar animated:YES];
    
    
}
- (IBAction)pushButtonPressed:(UIButton *)sender {
    
    PushCarViewController * pushCar = [[PushCarViewController alloc]init];
    
    [self.navigationController pushViewController:pushCar animated:YES];
    
}

-(void)buttonPressed:(UIButton *)sender
{
    
[[ControllerManger sharedManager].drawerVC openLeftDrawer];


}

@end
